{{- if .Values.nodeManager.earlyOomEnabled }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: early-oom
  namespace: d8-cloud-instance-manager
  {{- include "helm_lib_module_labels" (list . (dict "app" "early-oom")) | nindent 2 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: d8:node-manager:early-oom:rbac-proxy
  {{- include "helm_lib_module_labels" (list . (dict "app" "early-oom")) | nindent 2 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: d8:rbac-proxy
subjects:
- kind: ServiceAccount
  name: early-oom
  namespace: d8-cloud-instance-manager
{{- end }}
